<?php
$this->load->view($this->template->tpl_prefix_admin . 'youtube/header');
?>
<form method="post" action="<?php echo $this->url_index.'/addvideo/'.$editID;?>">
 <input type="submit" name="send" class="btn btn-primary" value="Get Videos from Playlist <?php echo $info->YOUT_TITLE;?>"/>
</form>
<?php
$header = array('Thumb', 'User name','Link','Duyệt','Trạng thái');
$config = array(
    'header_icon' => 'icon-list',
    'header_title' => 'Quản lý '.@$tresource->RES_NAME,
    'ID' => '0',
    'showEdit' => false,
    'showDelete' => false,
);
if ($this->permission->check("delete", $this->resCode))
    $config['showDelete'] = true;

if ($this->permission->check("update", $this->resCode))
    $config['showEdit'] = true;

$data = array();
//Các project tham gia
$stt = 0;
foreach ($datas as $result) {
    $data[] = array($result->YOUT_ID,'<img src="https://i1.ytimg.com/vi/'.$result->YOUT_LINK.'/default.jpg">', '<a class="youtube-title" href="#">'.$result->YOUT_TITLE.'</a>', '<a href="https://www.youtube.com/watch?v='.$result->YOUT_LINK.'" class="" target="_blank">Link</a>',($result->YOUT_STATUS == 1)?'<a href="'.$this->url_index.'/transvideo/'.$result->YOUT_ID.'" class="btn btn-primary">Duyệt</a>':'', ($result->YOUT_STATUS == 1)?'Hiện':'Ẩn');
}

echo $this->atheme->table_simple($header, $data, $config);
?>
<script>
$.fn.editable.defaults.mode = 'inline';
$('.youtube-title').editable({
    type: 'text',
    title: 'Enter username',
    success: function(response, newValue) {
        userModel.set('username', newValue); //update backbone model
    }
});
</script>
